import { defineStore } from 'pinia'
import { ref } from 'vue'
//import { userGetHistoryNews } from '@/api/news'
//用户模块token setToken removeToken
export const useNameStore = defineStore('Name', () => {
  const nameList = ref({})

  const initNameList = (allUserList) => {
    for (let i = 0; i < allUserList.length; i++) {
      nameList.value[`${allUserList[i].username}`] = allUserList[i].name

    }
    console.log('对应的昵称表：')
    console.log(nameList.value)
  }
  const addNameList = async () => {}
  const removeNameList = (news) => {
    nameList.value.push(news)
  }
  return {
    nameList,
    initNameList,
    addNameList,
    removeNameList
  }
})
